package com.siyoumi.app.modules.user.admin;

import com.baomidou.mybatisplus.extension.conditions.update.UpdateChainWrapper;
import com.siyoumi.app.entity.SysAddress;
import com.siyoumi.app.entity.SysUser;
import com.siyoumi.app.entity.WxUser;
import com.siyoumi.app.entity.WxUserInfo;
import com.siyoumi.app.modules.user.service.SvcSysUser;
import com.siyoumi.app.service.SysAddressService;
import com.siyoumi.app.service.WxUserInfoService;
import com.siyoumi.app.service.WxUserService;
import com.siyoumi.controller.AdminApiController;
import com.siyoumi.exception.EnumSys;
import com.siyoumi.util.*;
import com.siyoumi.component.http.InputData;
import com.siyoumi.component.http.XHttpContext;
import com.siyoumi.validator.XValidator;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/xadmin/user/user__edit")
public class user__edit
        extends AdminApiController {
    @GetMapping()
    public XReturn index() {
        setPageTitle("用户-详情");

        Map<String, Object> data = new HashMap<>();
        if (isAdminEdit()) {
            SysUser entity = SvcSysUser.getApp().getEntity(getID(), XHttpContext.getX());
            if (entity == null) {
                return XReturn.getR(20036, "id异常");
            }
            //合并
            data = entity.toMap();
        }

        getR().setData("data", data);

        return getR();
    }
}

